﻿<phone:PhoneApplicationPage
    x:Class="Techdays2013.SpeechRecognitionPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    SupportedOrientations="Portrait" Orientation="Portrait"
    mc:Ignorable="d"
    xmlns:behaviors="clr-namespace:SamuelBlanchard.Accessibility" 
    behaviors:SpeechBehavior.CanSpeak="True"
    behaviors:SpeechBehavior.Language="fr-FR"
    
    xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit"
    shell:SystemTray.IsVisible="True"  
    >

    <!--LayoutRoot is the root grid where all page content is placed-->
    <Grid x:Name="LayoutRoot" Background="Transparent">

        <ScrollViewer ScrollViewer.HorizontalScrollBarVisibility="Disabled" ScrollViewer.VerticalScrollBarVisibility="Auto">
            <Grid Margin="6">

                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto"></RowDefinition>
                    <RowDefinition Height="*"></RowDefinition>
                </Grid.RowDefinitions>
                
                <Border Height="173" VerticalAlignment="Top"  Background="Orange" Margin="6">
                    <StackPanel Margin="12" VerticalAlignment="Center">
                        <TextBlock x:Name="Title" behaviors:SpeechBehavior.Language="en-US" Text="Speech Recognition" FontSize="50" FontFamily="Segoe WP light" HorizontalAlignment="Center" Margin="12,0"/>
                    </StackPanel>
                </Border>

                <Grid Background="White" Grid.Row="1" Margin="6">

                    <TextBlock x:Name="TextBlockTitle" FontSize="60" TextWrapping="Wrap" Width="400" TextAlignment="Center" Margin="0,40,0,0" FontFamily="Segoe WP Light" HorizontalAlignment="Center" Foreground="Black">
                        <Run Text="Mr et Mme " />
                        <Run x:Name="RunFamille" Foreground="DodgerBlue" Text="{Binding CurrentBlague.Famille}" />
                        <Run Text=" ont " />
                        <Run x:Name="RunEnfant" Foreground="DodgerBlue" Text="{Binding CurrentBlague.EnfantString}" />
                    </TextBlock>

                    <Canvas x:Name="BonhommeCanvas" Margin="50,0,0,0" VerticalAlignment="Bottom" HorizontalAlignment="Left" Width="270" Height="199" Tap="Bonhomme_Tap">
                        <Canvas Width="268.657" Height="116" Canvas.Left="0" Canvas.Top="82.6667">
                            <Rectangle Width="173.333" Height="116" Canvas.Left="23.3438" Canvas.Top="0" Stretch="Fill" Fill="{Binding BonhommeBrush}"/>
                            <Path Width="268.648" Height="41.747" Canvas.Left="0.00924492" Canvas.Top="21.939" Stretch="Fill" Fill="{Binding BonhommeBrush}" Data="F1 M 0.0300827,22.3527L 0.0423965,23.6061C 0.0203323,23.3002 0.00924492,22.9935 0.00924492,22.686C 0.00924492,22.4365 0.0165482,22.1875 0.0310898,21.939C 0.0304184,22.0768 0.0300827,22.2147 0.0300827,22.3527 Z M 134.322,63.686C 61.6045,63.686 2.38431,46.0459 0.0789223,24.0193L 268.657,24.0193C 267.454,46.333 207.748,63.686 134.322,63.686 Z "/>
                            <Rectangle Width="25.75" Height="11.5" Canvas.Left="1.90735e-006" Canvas.Top="13.5792" Stretch="Fill" Fill="{Binding BonhommeBrush}"/>
                        </Canvas>
                        
                        <Canvas Width="268.667" Height="107.333" Canvas.Left="0.0104179" Canvas.Top="0">

                            <Canvas.Resources>
                                <Storyboard SpeedRatio="5" x:Name="StoryboardHead" AutoReverse="True">
                                    <DoubleAnimation From="0" To="-8" Storyboard.TargetName="TransformHead" Storyboard.TargetProperty="TranslateY"></DoubleAnimation>
                                </Storyboard>
                            </Canvas.Resources>
                            
                            <Canvas.RenderTransform>
                                <CompositeTransform x:Name="TransformHead" TranslateY="0"></CompositeTransform>
                            </Canvas.RenderTransform>

                            <Path Width="268.667" Height="107.333" Canvas.Left="0" Canvas.Top="0" Stretch="Fill" Fill="{Binding BonhommeBrush}" Data="F1 M 134.333,0C 208.524,0 268.667,47.3086 268.667,105.667C 268.667,106.223 268.661,106.779 268.65,107.333L 0.0163727,107.333C 0.00547218,106.779 0,106.223 0,105.667C 0,47.3086 60.1431,0 134.333,0 Z "/>
                            <Path Width="62.9667" Height="27.3" Canvas.Left="193.631" Canvas.Top="65.2042" Stretch="Fill" StrokeThickness="4.3" StrokeLineJoin="Round" Stroke="#FFFFFFFF" Fill="#FFFFFFFF" Data="F1 M 225.115,67.3542C 241.315,67.3542 254.448,76.01 254.448,86.6875C 254.448,87.9412 254.267,89.167 253.921,90.3542L 196.308,90.3542C 195.962,89.167 195.781,87.9412 195.781,86.6875C 195.781,76.01 208.914,67.3542 225.115,67.3542 Z "/>
                            <Path Width="24.2166" Height="22.2167" Canvas.Left="201.965" Canvas.Top="65.4541" Stretch="Fill" StrokeThickness="4.3" StrokeLineJoin="Round" Stroke="{Binding BonhommeBrush}" Fill="{Binding BonhommeBrush}" Data="F1 M 214.073,70.6041C 219.573,70.6041 224.031,74.6149 224.031,79.5625C 224.031,84.5101 219.573,88.5209 214.073,88.5209C 208.573,88.5209 204.115,84.5101 204.115,79.5625C 204.115,74.6149 208.573,70.6041 214.073,70.6041 Z "/>
                            <Path Width="62.9667" Height="27.3" Canvas.Left="116.131" Canvas.Top="65.2042" Stretch="Fill" StrokeThickness="4.3" StrokeLineJoin="Round" Stroke="#FFFFFFFF" Fill="#FFFFFFFF" Data="F1 M 147.615,67.3542C 131.414,67.3542 118.281,76.01 118.281,86.6875C 118.281,87.9412 118.462,89.167 118.808,90.3542L 176.421,90.3542C 176.767,89.167 176.948,87.9412 176.948,86.6875C 176.948,76.01 163.815,67.3542 147.615,67.3542 Z "/>
                            <Ellipse Width="24.2166" Height="22.2167" Canvas.Left="146.548" Canvas.Top="65.4541" Stretch="Fill" StrokeThickness="4.3" StrokeLineJoin="Round" Stroke="{Binding BonhommeBrush}" Fill="{Binding BonhommeBrush}"/>
                            
                        </Canvas>
                    </Canvas>

                    <StackPanel x:Name="StackPanelButtons" HorizontalAlignment="Right" VerticalAlignment="Bottom" >
                        <Button Margin="12,12,12,0" Click="Button_Click_Result">
                            <Button.Template>
                                <ControlTemplate TargetType="Button">
                                    <ContentPresenter></ContentPresenter>
                                </ControlTemplate>
                            </Button.Template>

                            <Image Stretch="None" Source="Assets/Icons/Result.png"></Image>
                        </Button>

                        <Button Margin="12" Click="Button_Click_UI">
                            <Button.Template>
                                <ControlTemplate TargetType="Button">
                                    <ContentPresenter></ContentPresenter>
                                </ControlTemplate>
                            </Button.Template>

                            <Image x:Name="PictureWindows" Stretch="None" Source="Assets/Icons/Windows.png"></Image>
                        </Button>
                    </StackPanel>

                </Grid>
            </Grid>
        </ScrollViewer>

        <Grid x:Name="GridFade" Background="Black" Visibility="Collapsed">
        </Grid>
        
    </Grid>

</phone:PhoneApplicationPage>